<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			* {
				margin: 0px;
				padding: 0px;
			}
			body{
				background-image: url('首页/img/公园.bmp');
				width: 100%;
				height: 100%;
				background-size: cover;
			}
			.left {
				float: left;
				width: 400px;
			 	height: 700px;
				margin-left: 100px;

			}

			.center {
				float: left;
				width: 400px;
				height: 700px;
				margin-left: 70px;
			}

			.right {
				float: right;
				width: 400px;
				height: 700px;
				margin-right: 100px;
			}

			.zuoshang {
				width: 400px;
				height: 250px;
				margin-top: 50px;
				border:;
				position: relative;
				background-image: url('首页/img/气泡-中.png');
				background-size: cover;
				top: 105px;
			}

			.zuoxia {
				width: 300px;
				height: 300px;
				margin-top: 20px;
				margin-left: 200px;
				position: absolute;
				background-image: url("首页/img/老人4.png");
				background-size: cover;
			}

			.zhongshang {
				width: 400px;
				height: 50px;
				margin-top: 10px;
				background-color:#FFFFF0;
				text-align: center;
				display:none;
			}

			.zhongxia {
				width: 400px;
				height: 500px;
				margin-top: 100px;
			}

			.duihuakuan {
				position: fixed;
				width: 400px;
				height: 250px;
				margin-top: 220px;
				background-image: url('首页/img/气泡-左.png');
				background-size: cover;
				right: 300px;
				top: 0px;
			}

			.hongbao {
				position: fixed;
				margin-left: 20px;
				border: red solid 2px;
				width: 50px;
				top: 420px;
				left: 390px;
				z-index: 9999;
			}

			.zuowenzi {
				position: fixed;
				width: 200px;
				height: 100px;
				margin-left: 100px;
				margin-top: 80px;
				text-align: center;
				line-height: 40px;
				top:160px;
			}

			.youwenzi {
			
				width: 200px;
				height: 200px;
				margin-left: 100px;
				margin-top: 80px;
				text-align: center;
				line-height: 40px;
				top: 250px;
			}

			.shoubi {
				position:absolute;
				width: 50px;
				height: 50px;
				left: 690px;
				top: 275px;
			}
		</style>
		<script src="首页/jswj/jquery-2.2.4.js"></script>
		<script>
			function dragPic(e) {
				var e = window.event;
				var myElement = e.srcElement
				if (e.preventDefault) {
					e.preventDefault();
				} else {
					e.returnvalue = false;
				}
				var hongbao = document.getElementById('hongbao');
				hongbao['draging'] = true;
				var relLeft = e.clientX - parseInt(myElement.style.left);
				var reltop = e.clientY - parseInt(myElement.style.top);
			
				myElement.onmouseup = function() {
					hongbao['draging'] = false;
				}
				document.onmousemove = function(eMove) {
					var eMove = eMove || window.event;
					if (hongbao['draging'] == true) {
						myElement.style.left = eMove.clientX - relLeft + "px";
						myElement.style.top = eMove.clientY - reltop + "px";
						console.log(myElement.style.left+','+myElement.style.top)
						return false;
					}
				}
			}
			window.onload = function() {
				var hongbao = document.getElementById("hongbao");
				hongbao['darging'] = false;
				if (navigator.userAgent.indexOf("MSIE") > 0) {
					hongbao.attachEvent("onmousedown", dragPic);
				} else {
					hongbao.addEventListener('mousedown', dragPic, false);
				}
			}
		</script>
	</head>
	<body>
		<img src="首页/img/钱.png" alt=""
		style="position: absolute; left:535px; top: 450px; size: 100%;width: 30px; z-index: 9999;"  id="hongbao">
		<div class="left">
			<div class="zuoshang" id="zuoduihuakuan">
				<div class="zuowenzi" id="zuowenzi"></div>
			</div>
			<div class="zuoxia" id="zuoxia"></div>
		</div>
		<div class="center">
			<div class="zhongshang" id="tishi"></div>
			<div class="zhongxia">
				<img src="首页/img/卖药人1.png" alt=""
					style="background-size:cover; width: 380px; position: absolute; top: 175px;" id="maiyaoren">
				<div class="shoubi" id="shoubi"></div>
			</div>
		</div>
		<div class="right">
			<div class="duihuakuan" id="youduihuakuan">
				<div class="youwenzi" id="youwenzi">

				</div>
			</div>
		</div>
		<script>
			$(function() {
				document.getElementById('zuoduihuakuan').style.backgroundImage = "url(' ')"
				document.getElementById('youduihuakuan').style.backgroundImage = "url(' ')"
				var key = 1
				var f = 1
				window.onclick = function() {
					if (key == 1) {
						document.getElementById('youduihuakuan').style.backgroundImage =
							"url('首页/img/气泡-左.png')"
						setTimeout(function() {
							document.getElementById('youwenzi').innerHTML = '听养生讲座送鸡蛋，快来，来晚了，就没鸡蛋送了'
							document.getElementById('maiyaoren').src='首页/img/卖药人.gif'
						}, 500)
						key++
					} else if (key == 2) {
						document.getElementById('maiyaoren').src='首页/img/卖药人1.png'
						document.getElementById('youduihuakuan').style.backgroundImage = "url(' ')"
						document.getElementById('youwenzi').innerHTML = ''
						key++
					} else if (key == 3) {
						document.getElementById('zuoduihuakuan').style.backgroundImage =
							"url('首页/img/气泡-中.png')"
						setTimeout(function() {
							document.getElementById('zuoxia').style.backgroundImage="url('首页/img/老爷爷.gif')"
							document.getElementById('zuowenzi').innerHTML = '还有这种好事，我要去看看，随便免费搞点鸡蛋'
						}, 500)
						key++
					} else if (key == 4) {
						document.getElementById('zuoxia').style.backgroundImage="url('首页/img/老人4.png')"
						document.getElementById('zuoduihuakuan').style.backgroundImage = "url(' ')"
						document.getElementById('zuowenzi').innerHTML = ' '
						key++
					} else if (key == 5) {
						 document.getElementById('youduihuakuan').style.backgroundImage =
							"url('首页/img/气泡-左.png')"
						setTimeout(function() {
							document.getElementById('maiyaoren').src='首页/img/卖药人.gif'
							document.getElementById('youwenzi').innerHTML =
								'我们专家研发了一种特效药，对于老年人引发的大多数疾病能得到有效治疗'
						}, 500)
						key++
					} else if (key == 6) {
						document.getElementById('maiyaoren').src='首页/img/卖药人1.png'
						document.getElementById('youduihuakuan').style.backgroundImage = "url(' ')"
						document.getElementById('youwenzi').innerHTML = ' '
						key++
					} else if (key == 7) {
						document.getElementById('zuoduihuakuan').style.backgroundImage =
							"url('首页/img/气泡-中.png')"
						setTimeout(function() {
							document.getElementById('zuoxia').style.backgroundImage="url('首页/img/老爷爷.gif')"
							document.getElementById('zuowenzi').innerHTML = '这个东西好，有这个药我就不用去医院浪费钱了'
						}, 500)
						key++
					} else if (key == 8) {
						document.getElementById('zuoxia').style.backgroundImage="url('首页/img/老人4.png')"
						document.getElementById('zuoduihuakuan').style.backgroundImage = "url(' ')"
						document.getElementById('zuowenzi').innerHTML = ' '
						key++
					} else if (key == 9) {
						document.getElementById('tishi').style.display='block'
						document.getElementById('tishi').innerHTML = '拖动红包，将钱交给卖药人'
						document.getElementById('shoubi').style.border='red solid 1px'
						// key++
						f = 0;
					}
					hb=document.getElementById('hongbao')
					if(f==0&&parseInt(hb.style.left)>691&&parseInt(hb.style.left)<709&&parseInt(hb.style.top)<295&&parseInt(hb.style.top)>276){
						
						window.location.href="zhapianxianchang.html"
					}
				}
			
			})
		</script>
	</body>
</html>
